home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / clarion / cw15 / tpw15.z / WINDOW.TPW < prev    next >
Text File  |  1995-08-25  |  5KB  |  133 lines

  1. #PROCEDURE(Window,'Generic Window Handler'),WINDOW,HLP('~TPLProcWindow')
  2. #LOCALDATA
  3. LocalRequest         LONG,AUTO
  4. OriginalRequest      LONG,AUTO
  5. LocalResponse        LONG,AUTO
  6. WindowOpened         LONG
  7. WindowInitialized    LONG
  8. ForceRefresh         LONG,AUTO
  9. #ENDLOCALDATA
  10. #CLASS('Procedure Setup','Upon Entry into the Procedure')
  11. #CLASS('Before Lookups','Refresh Window ROUTINE, before lookups')
  12. #CLASS('After Lookups','Refresh Window ROUTINE, after lookups')
  13. #CLASS('Procedure Exit','Before Leaving the Procedure')
  14. #PROMPT('P&arameters:',@s255),%Parameters
  15. #ENABLE(%ProcedureType='FUNCTION')
  16.   #PROMPT('Return Value:',FIELD),%ReturnValue
  17. #ENDENABLE
  18. #PROMPT('Window Operation Mode:',DROP('Use WINDOW setting|Normal|MDI|Modal')),%WindowOperationMode
  19. #ENABLE(%INIActive)
  20.   #BOXED('INI File Settings')
  21.     #PROMPT('Save and Restore Window Location',CHECK),%INISaveWindow,DEFAULT(1),AT(10,,150)
  22.   #ENDBOXED
  23. #ENDENABLE
  24. #AT(%CustomGlobalDeclarations)
  25.   #INSERT(%StandardGlobalSetup)
  26. #ENDAT
  27. #INSERT(%StandardWindowCode)
  28. #!---------------------------------------------------------
  29. #GROUP(%StandardWindowCode)
  30. #IF(NOT %Window)
  31.   #ERROR(%Procedure & ' Error: No Window Defined!')
  32.   #RETURN
  33. #ENDIF
  34. #DECLARE(%FirstField)
  35. #DECLARE(%LastField)
  36. #DECLARE(%ProgressWindowRequired)
  37. #INSERT(%FieldTemplateStandardButtonMenuPrompt)
  38. #INSERT(%FieldTemplateStandardEntryPrompt)
  39. #INSERT(%FieldTemplateStandardCheckBoxPrompt)
  40. #EMBED(%GatherSymbols,'Gather Template Symbols'),HIDE
  41. #INSERT(%FileControlInitialize)
  42. %Procedure %ProcedureType%Parameters
  43.  
  44. #FOR(%LocalData)
  45. %[20]LocalData %LocalDataStatement
  46. #ENDFOR
  47. #INSERT(%StandardWindowGeneration)
  48. #IF(%ProgressWindowRequired)
  49. #INSERT(%StandardProgressWindow)
  50. #ENDIF
  51.   CODE
  52.   #EMBED(%ProcedureInitialize,'Initialize the Procedure')
  53.   LocalRequest = GlobalRequest
  54.   OriginalRequest = GlobalRequest
  55.   LocalResponse = RequestCancelled
  56.   ForceRefresh = False
  57.   CLEAR(GlobalRequest)
  58.   CLEAR(GlobalResponse)
  59.   #EMBED(%ProcedureSetup,'Procedure Setup')
  60.   IF KEYCODE() = MouseRight
  61.     SETKEYCODE(0)
  62.   END
  63.   #INSERT(%StandardFormula,'Procedure Setup')
  64.   #INSERT(%FileControlOpen)
  65.   #INSERT(%StandardWindowOpening)
  66.   #EMBED(%PrepareAlerts,'Preparing Window Alerts')
  67.   #EMBED(%BeforeAccept,'Preparing to Process the Window')
  68.   #MESSAGE('Accept Handling',3)
  69.   ACCEPT
  70.     #EMBED(%AcceptLoopBeforeEventHandling,'Accept Loop, Before CASE EVENT() handling')
  71.     CASE EVENT()
  72.     #EMBED(%EventCaseBeforeGenerated,'CASE EVENT() structure, before generated code')
  73.     #INSERT(%StandardWindowHandling)
  74.     #EMBED(%EventCaseAfterGenerated,'CASE EVENT() structure, after generated code')
  75.     END
  76.     #EMBED(%AcceptLoopAfterEventHandling,'Accept Loop, After CASE EVENT() handling')
  77.     #SUSPEND
  78.     #?CASE ACCEPTED()
  79.     #INSERT(%StandardAcceptedHandling)
  80.     #?END
  81.     #RESUME
  82.     #EMBED(%AcceptLoopBeforeFieldHandling,'Accept Loop, Before CASE FIELD() handling')
  83.     #SUSPEND
  84.     #?CASE FIELD()
  85.     #EMBED(%FieldCaseBeforeGenerated,'CASE FIELD() structure, before generated code')
  86.     #INSERT(%StandardControlHandling)
  87.     #EMBED(%FieldCaseAfterGenerated,'CASE FIELD() structure, after generated code')
  88.     #?END
  89.     #RESUME
  90.     #EMBED(%AcceptLoopAfterFieldHandling,'Accept Loop, After CASE FIELD() handling')
  91.   END
  92.   DO ProcedureReturn
  93. !---------------------------------------------------------------------------
  94. ProcedureReturn ROUTINE
  95.   #INSERT(%FileControlClose)
  96.   #INSERT(%StandardWindowClosing)
  97.   #EMBED(%EndOfProcedure,'End of Procedure')
  98.   #INSERT(%StandardFormula,'Procedure Exit')
  99.   IF LocalResponse
  100.     GlobalResponse = LocalResponse
  101.   ELSE
  102.     GlobalResponse = RequestCancelled
  103.   END
  104.   #IF(%ProcedureType='FUNCTION')
  105.   RETURN(%ReturnValue)
  106.   #ELSE
  107.   RETURN
  108.   #ENDIF
  109. !---------------------------------------------------------------------------
  110. InitializeWindow ROUTINE
  111.   #EMBED(%WindowInitializationCode,'Window Initialization Code')
  112.   DO RefreshWindow
  113. !---------------------------------------------------------------------------
  114. RefreshWindow ROUTINE
  115.   IF %Window{Prop:AcceptAll} THEN EXIT.
  116.   #EMBED(%RefreshWindowBeforeLookup,'Refresh Window routine, before lookups')
  117.   #INSERT(%StandardFormula,'Before Lookups')
  118.   #INSERT(%StandardSecondaryLookups)
  119.   #INSERT(%StandardFormula,'After Lookups')
  120.   #EMBED(%RefreshWindowAfterLookup,'Refresh Window routine, after lookups')
  121.   #EMBED(%RefreshWindowBeforeDisplay,'Refresh Window routine, before DISPLAY()')
  122.   DISPLAY()
  123.   ForceRefresh = False
  124. !---------------------------------------------------------------------------
  125. SyncWindow ROUTINE
  126.   #EMBED(%SyncWindowBeforeLookup,'Sync Record routine, before lookups')
  127.   #INSERT(%StandardFormula,'Before Lookups')
  128.   #INSERT(%StandardSecondaryLookups)
  129.   #INSERT(%StandardFormula,'After Lookups')
  130.   #EMBED(%SyncWindowAfterLookup,'Sync Record routine, after lookups')
  131. !---------------------------------------------------------------------------
  132. #EMBED(%ProcedureRoutines,'Procedure Routines')
  133.